package com.dy.排序.内排序;
//顺序表记录关键字类
public class KeyType implements Comparable<KeyType> {
    public int key;

    public KeyType() {
    }

    public KeyType(int key) {
        this.key = key;
    }
    @Override
    public String toString(){
        return key+"";
    }

    @Override
    public int compareTo(KeyType o) {
        int thisVal = this.key;
        int anotherVal = o.key;
        return (thisVal<anotherVal? -1:(thisVal ==anotherVal?0:1));
    }
}
